package at.pervasive.mp3player.actions;

import java.awt.event.ActionEvent;

import javax.swing.JList;

import at.pervasive.mp3player.Mp3Player;

public class RemoveFilesAction extends AbstractMp3PlayerAction
{

	private static final long serialVersionUID = -99430434286370345L;
	
	private final JList list;

	public RemoveFilesAction(Mp3Player player, JList list)
	{
		super(player);
		this.list = list;
		putValue(LARGE_ICON_KEY, getIcon("remove.png"));
	}

	@Override
	public void actionPerformed(ActionEvent e)
	{
		int[] selectedIndices = list.getSelectedIndices();
		player.remove(selectedIndices);
	}
}
